<?php
// vim: set ts=4 sw=4 sts=4 et:

/**
 * LiteCommerce
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to licensing@litecommerce.com so we can send you a copy immediately.
 *
 * @category   LiteCommerce
 * @package    XLite
 * @subpackage Model_Proxy
 * @author     Creative Development LLC <info@cdev.ru>
 * @copyright  Copyright (c) 2011 Creative Development LLC <info@cdev.ru>. All rights reserved
 * @license    http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * @link       http://www.litecommerce.com/
 * @see        ____file_see____
 * @since      1.0.0
 */

namespace XLite\Model\Proxy;

/**
 * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE
 *
 * @package    XLite
 * @see        ____class_see____
 * @since      1.0.0
 */
class XLiteModelProductProxy extends \XLite\Model\Product implements \Doctrine\ORM\Proxy\Proxy
{
    /**
     * _entityClass
     *
     * @var    string
     * @access protected
     * @see    ____var_see____
     * @since  1.0.0
     */
    protected $_entityClass;

    /**
     * _entityPersister
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_entityPersister;

    /**
     * _identifier
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_identifier;

    /**
     * __isInitialized__
     *
     * @var    mixed
     * @access public
     * @see    ____var_see____
     * @since  1.0.0
     */
    public $__isInitialized__ = false;

    /**
     * __construct
     *
     * @param mixed $entityPersister ____param_comment____
     * @param mixed $identifier      ____param_comment____
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __construct($entityPersister, $identifier)
    {
        $this->_entityPersister = $entityPersister;
        $this->_identifier = $identifier;
        $this->_entityClass = 'XLite\Model\Product';
    }

    /**
     * _load
     *
     * @return void
     * @access private
     * @see    ____func_see____
     * @since  1.0.0
     */
    private function _load()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;
            if ($this->_entityPersister->load($this->_identifier, $this) === null) {
                return;
            }
            unset($this->_entityPersister);
            unset($this->_identifier);
        }
    }

    
    public function setName($value)
    {
        $this->_load();
        return parent::setName($value);
    }

    public function getDescription()
    {
        $this->_load();
        return parent::getDescription();
    }

    public function setDescription($value)
    {
        $this->_load();
        return parent::setDescription($value);
    }

    public function getBriefDescription()
    {
        $this->_load();
        return parent::getBriefDescription();
    }

    public function setBriefDescription($value)
    {
        $this->_load();
        return parent::setBriefDescription($value);
    }

    public function getMetaTags()
    {
        $this->_load();
        return parent::getMetaTags();
    }

    public function setMetaTags($value)
    {
        $this->_load();
        return parent::setMetaTags($value);
    }

    public function getMetaDesc()
    {
        $this->_load();
        return parent::getMetaDesc();
    }

    public function setMetaDesc($value)
    {
        $this->_load();
        return parent::setMetaDesc($value);
    }

    public function getMetaTitle()
    {
        $this->_load();
        return parent::getMetaTitle();
    }

    public function setMetaTitle($value)
    {
        $this->_load();
        return parent::setMetaTitle($value);
    }

    public function getProductId()
    {
        $this->_load();
        return parent::getProductId();
    }

    public function setPrice($price)
    {
        $this->_load();
        return parent::setPrice($price);
    }

    public function setSalePrice($salePrice)
    {
        $this->_load();
        return parent::setSalePrice($salePrice);
    }

    public function getSalePrice()
    {
        $this->_load();
        return parent::getSalePrice();
    }

    public function setSku($sku)
    {
        $this->_load();
        return parent::setSku($sku);
    }

    public function setEnabled($enabled)
    {
        $this->_load();
        return parent::setEnabled($enabled);
    }

    public function getEnabled()
    {
        $this->_load();
        return parent::getEnabled();
    }

    public function setWeight($weight)
    {
        $this->_load();
        return parent::setWeight($weight);
    }

    public function setFreeShipping($freeShipping)
    {
        $this->_load();
        return parent::setFreeShipping($freeShipping);
    }

    public function setCleanUrl($cleanUrl)
    {
        $this->_load();
        return parent::setCleanUrl($cleanUrl);
    }

    public function getCleanUrl()
    {
        $this->_load();
        return parent::getCleanUrl();
    }

    public function setJavascript($javascript)
    {
        $this->_load();
        return parent::setJavascript($javascript);
    }

    public function getJavascript()
    {
        $this->_load();
        return parent::getJavascript();
    }

    public function setDate($date)
    {
        $this->_load();
        return parent::setDate($date);
    }

    public function getDate()
    {
        $this->_load();
        return parent::getDate();
    }

    public function addFeaturedProducts(\XLite\Module\CDev\FeaturedProducts\Model\FeaturedProduct $featuredProducts)
    {
        $this->_load();
        return parent::addFeaturedProducts($featuredProducts);
    }

    public function getFeaturedProducts()
    {
        $this->_load();
        return parent::getFeaturedProducts();
    }

    public function addCategoryProducts(\XLite\Model\CategoryProducts $categoryProducts)
    {
        $this->_load();
        return parent::addCategoryProducts($categoryProducts);
    }

    public function getCategoryProducts()
    {
        $this->_load();
        return parent::getCategoryProducts();
    }

    public function addOrderItems(\XLite\Model\OrderItem $orderItems)
    {
        $this->_load();
        return parent::addOrderItems($orderItems);
    }

    public function getOrderItems()
    {
        $this->_load();
        return parent::getOrderItems();
    }

    public function addImages(\XLite\Model\Image\Product\Image $images)
    {
        $this->_load();
        return parent::addImages($images);
    }

    public function getImages()
    {
        $this->_load();
        return parent::getImages();
    }

    public function setInventory(\XLite\Model\Inventory $inventory)
    {
        $this->_load();
        return parent::setInventory($inventory);
    }

    public function addClasses(\XLite\Model\ProductClass $classes)
    {
        $this->_load();
        return parent::addClasses($classes);
    }

    public function getClasses()
    {
        $this->_load();
        return parent::getClasses();
    }

    public function getId()
    {
        $this->_load();
        return parent::getId();
    }

    public function getWeight()
    {
        $this->_load();
        return parent::getWeight();
    }

    public function getPrice()
    {
        $this->_load();
        return parent::getPrice();
    }

    public function getName()
    {
        $this->_load();
        return parent::getName();
    }

    public function getSku()
    {
        $this->_load();
        return parent::getSku();
    }

    public function getImage()
    {
        $this->_load();
        return parent::getImage();
    }

    public function getFreeShipping()
    {
        $this->_load();
        return parent::getFreeShipping();
    }

    public function isAvailable()
    {
        $this->_load();
        return parent::isAvailable();
    }

    public function getListPrice()
    {
        $this->_load();
        return parent::getListPrice();
    }

    public function hasImage()
    {
        $this->_load();
        return parent::hasImage();
    }

    public function getImageURL()
    {
        $this->_load();
        return parent::getImageURL();
    }

    public function getCategory($categoryId = NULL)
    {
        $this->_load();
        return parent::getCategory($categoryId);
    }

    public function getCategoryId($categoryId = NULL)
    {
        $this->_load();
        return parent::getCategoryId($categoryId);
    }

    public function getCategories()
    {
        $this->_load();
        return parent::getCategories();
    }

    public function getURL()
    {
        $this->_load();
        return parent::getURL();
    }

    public function getMinPurchaseLimit()
    {
        $this->_load();
        return parent::getMinPurchaseLimit();
    }

    public function getMaxPurchaseLimit()
    {
        $this->_load();
        return parent::getMaxPurchaseLimit();
    }

    public function getInventory()
    {
        $this->_load();
        return parent::getInventory();
    }

    public function getOrderBy($categoryId = NULL)
    {
        $this->_load();
        return parent::getOrderBy($categoryId);
    }

    public function countImages()
    {
        $this->_load();
        return parent::countImages();
    }

    public function getCommonDescription()
    {
        $this->_load();
        return parent::getCommonDescription();
    }

    public function getTaxableBasis()
    {
        $this->_load();
        return parent::getTaxableBasis();
    }

    public function getArrivalDate()
    {
        $this->_load();
        return parent::getArrivalDate();
    }

    public function setArrivalDate($date)
    {
        $this->_load();
        return parent::setArrivalDate($date);
    }

    public function getLabels()
    {
        $this->_load();
        return parent::getLabels();
    }

    public function prepareDate()
    {
        $this->_load();
        return parent::prepareDate();
    }

    public function getTranslations()
    {
        $this->_load();
        return parent::getTranslations();
    }

    public function addTranslations(\XLite\Model\Base\Translation $translation)
    {
        $this->_load();
        return parent::addTranslations($translation);
    }

    public function getTranslation($code = NULL)
    {
        $this->_load();
        return parent::getTranslation($code);
    }

    public function getSoftTranslation($code = NULL)
    {
        $this->_load();
        return parent::getSoftTranslation($code);
    }

    public function setEditLanguageCode($code = NULL)
    {
        $this->_load();
        return parent::setEditLanguageCode($code);
    }

    public function hasTranslation($code = NULL)
    {
        $this->_load();
        return parent::hasTranslation($code);
    }

    public function getTranslationCodes()
    {
        $this->_load();
        return parent::getTranslationCodes();
    }

    public function detach()
    {
        $this->_load();
        return parent::detach();
    }

    public function map(array $data)
    {
        $this->_load();
        return parent::map($data);
    }

    public function __get($name)
    {
        $this->_load();
        return parent::__get($name);
    }

    public function __set($name, $value)
    {
        $this->_load();
        return parent::__set($name, $value);
    }

    public function __unset($name)
    {
        $this->_load();
        return parent::__unset($name);
    }

    public function getRepository()
    {
        $this->_load();
        return parent::getRepository();
    }

    public function checkCache()
    {
        $this->_load();
        return parent::checkCache();
    }

    public function __call($method, array $args = array (
))
    {
        $this->_load();
        return parent::__call($method, $args);
    }

    public function isPersistent()
    {
        $this->_load();
        return parent::isPersistent();
    }

    public function update()
    {
        $this->_load();
        return parent::update();
    }

    public function create()
    {
        $this->_load();
        return parent::create();
    }

    public function delete()
    {
        $this->_load();
        return parent::delete();
    }

    public function cloneEntity()
    {
        $this->_load();
        return parent::cloneEntity();
    }

    public function prepareEntityBeforeCommit()
    {
        $this->_load();
        return parent::prepareEntityBeforeCommit();
    }


    /**
     * __sleep
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __sleep()
    {
        return array('__isInitialized__', 'translations', 'featuredProducts', 'product_id', 'price', 'sale_price', 'sku', 'enabled', 'weight', 'free_shipping', 'clean_url', 'javascript', 'arrivalDate', 'date', 'categoryProducts', 'order_items', 'images', 'inventory', 'classes');
    }

    /**
     * __wakeup
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __wakeup()
    {
        if (isset($this->_identifier)) {
            foreach ($this->_identifier as $k => $v) {
                $this->$k = $v;
            }

            \Xlite\Core\Database::getEM()->getUnitOfWork()->removeFromIdentityMap($this);
            $this->_entityPersister = \XLite\Core\Database::getEM()->getUnitOfWork()->getEntityPersister($this->_entityClass);
        }
    }
}